/*
 * @Descripttion:
 * @version:
 * @Date: 2021-04-20 11:06:21
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2021-07-26 13:37:30
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 */
import request from '@/utils/request'

// 获取菜单,动态菜单需要的接口
export const GetMenus = params => {
  return request({
    url: '/api/menu/findUserMenu',
    method: 'get',
    params,
  })
}

//获取所有的树形菜单数据
export const getMenuList = () => {
  return request({
    url: '/api/menu/menuList',
    method: 'get',
  })
}

//根据登入用户获取所对应的菜单
export const postSaveMenu = sysMenu => {
  return request({
    url: '/api/menu/save',
    method: 'post',
    data: sysMenu,
  })
}

//修改菜单
export const postUpdateMenu = sysMenu => {
  return request({
    url: 'api/menu/update',
    method: 'put',
    data: sysMenu,
  })
}

//删除菜单
export const deleteMenu = id => {
  return request({
    url: `api/menu/delete/${id}`,
    method: 'delete',
  })
}
